{% extends "school/layout.html" %}

{% set page_title = translate('意见反馈') %}

{% block content %}
<div class="m-scontent">
	<div class="m-feedback">
		<div class="title">{{translate('意见反馈')}}</div>
		<p class="text">{{translate('请在下方输入您的意见或建议，我们将非常认真对待每一条反馈，谢谢！')}}</p>
		<form action="" method="post" enctype="multipart/form-data">
			<textarea name="text" class="form-control" rows="10"></textarea>
			<br />
			<!-- <div class="form-group">
				<label>联系方式：</label>
				<input type="text" name="phone" pattern="^((\d{3,4}-?)?\d{7,8})|\d{11}|\d{12}$" placeholder="{{ default_phone }}">
				<span>默认填写机构联系电话</span>
			</div>
			<div class="form-group">
				<label class="norequired">上传图片(或附件<8M)：</label>
				<input type="file" name="file">
			</div> -->
			<div class="upload">
				<div class="btn-upload">{{translate('上传图片或附件（不超过8MB，任意格式）')}}</div>
				<input type="file" class="file" name="file">
				<div class="upload-files"></div>
			</div>
			<div>
				<button class="btn btn-send">{{translate('提交')}}</button>
			</div>
		</form>
		<div class="sale-phone">
			<img src="/static/images/phone_icon.png">
			<span>{{translate('售后热线')}}</span>
			<span class="telephone">400-1108-770</span>
		</div>
	</div>
	
</div>
{% endblock %}
{% block js %}
<script type="text/javascript">
$(function(){
	$('.btn-upload').bind('click',function(){
		$('.file').click();
	});
	$('.file').bind('change',function(){
		var filename=$(this).val().replace(/\\/g,'/').split('/');
		filename=filename[filename.length-1];
		$('.upload-files').append('<div class="list">'+filename+'<span class="del">{{translate("删除")}}</span></div>')
		$('.btn-upload').hide();
	});
	$('.upload-files').delegate('.del','click',function(){
		$(this).parent().remove();
		$('.file').val('');
		$('.btn-upload').show();
	});
});
</script>
{% endblock %}
